CapitalGainResult

constructor(secAcct: Account?, asOfDateInt: Int?, selectedDateRange: DateRange?, totSaleShares: Long, totSaleSharesShort: Long, totSaleSharesLong: Long, totSaleSharesAvailable: Long, totSaleSharesAvailableShort: Long, totSaleSharesAvailableLong: Long, totSaleValue: Long, totSaleValueShort: Long, totSaleValueLong: Long, totSaleBasis: Long, totSaleBasisShort: Long, totSaleBasisLong: Long, totSaleGains: Long, totSaleGainsShort: Long, totSaleGainsLong: Long, isValid: Boolean, isSimpleResult: Boolean, isCompleteResult: Boolean, txn: SplitTxn?, errorMessageKey: String?, useTaxDate: Boolean = false, selectSalesByTaxDate: Boolean = false)


constructor(errorKey: String)

Constructor - invalid result with an error message.

Return

CapitalGainResult instance with no values, marked invalid, and with the specified error key.

Parameters

errorKey

Resource key for message to display to the user (localized).


constructor(txn: SplitTxn?, errorKey: String, useTaxDate: Boolean = false, selectSalesByTaxDate: Boolean = false)

Constructor - invalid result with an error message.

Return

CapitalGainResult instance with no values, marked invalid, and with the specified error key.

Parameters

errorKey

Resource key for message to display to the user (localized).

txn

the source txn for this error

useTaxDate

see CapitalGainResult.useTaxDate. Default false. @since MD2027

selectSalesByTaxDate

see CapitalGainResult.selectSalesByTaxDate. Default false. @since MD2027


constructor(basis: Long, shortTermBasis: Long, longTermBasis: Long, shortTermShares: Long, longTermShares: Long, shortTermAvailShares: Long, longTermAvailShares: Long, messageKey: String?)

Constructor - valid (simple) result with an optional message key.

Return

CapitalGainResult instance with (simple) values, marked valid, and with an optional message key.

Parameters

basis

Total combined basis for the sale transaction.

shortTermBasis

Short term gain basis - cost of short term portion of the sale.

longTermBasis

Long term gain basis - cost of long term portion of the sale.

shortTermShares

Number of short term shares sold.

longTermShares

Number of long term shares sold.

shortTermAvailShares

Total number of available short term shares.

longTermAvailShares

Total number of available long term shares.

messageKey

Resource key for message to display to the user (localized).


constructor(txn: SplitTxn?, basis: Long, shortTermBasis: Long, longTermBasis: Long, shortTermShares: Long, longTermShares: Long, shortTermAvailShares: Long, longTermAvailShares: Long, messageKey: String?)

Constructor - valid (simple) result with an optional message key.

Return

CapitalGainResult instance with (simple) values, marked valid, and with an optional message key.

Parameters

txn

The source txn for this sale/gain

basis

Total combined basis for the sale transaction.

shortTermBasis

Short term gain basis - cost of short term portion of the sale.

longTermBasis

Long term gain basis - cost of long term portion of the sale.

shortTermShares

Number of short term shares sold.

longTermShares

Number of long term shares sold.

shortTermAvailShares

Total number of available short term shares.

longTermAvailShares

Total number of available long term shares.

messageKey

Resource key for message to display to the user (localized).


constructor(secAcct: Account, asOfDateInt: Int?, selectedDateRange: DateRange?, totSaleShares: Long, totSaleSharesShort: Long, totSaleSharesLong: Long, totSaleSharesAvailable: Long, totSaleSharesAvailableShort: Long, totSaleSharesAvailableLong: Long, totSaleValue: Long, totSaleValueShort: Long, totSaleValueLong: Long, totSaleBasis: Long, totSaleBasisShort: Long, totSaleBasisLong: Long, totSaleGains: Long, totSaleGainsShort: Long, totSaleGainsLong: Long, messageKey: String?)

Constructor - valid (complete) result with an optional message key.

Return

CapitalGainResult instance with (complete) values, marked valid, and with an optional message key.

Parameters

secAcct

Security account for this gain.

asOfDateInt

The asof date used to calculate this gain.

selectedDateRange

The DateRange used when generating this gain.

totSaleShares

Number of shares sold.

totSaleSharesShort

Number of short term shares sold.

totSaleSharesLong

Number of long term shares sold.

totSaleSharesAvailable

Total number of available shares.

totSaleSharesAvailableShort

Total number of available short term shares.

totSaleSharesAvailableLong

Total number of available long term shares.

totSaleValue

Total sales value for this gain

totSaleValueShort

Short term sales value for this gain

totSaleValueLong

Long term sales value for this gain

totSaleBasis

Total combined basis for the sale transaction.

totSaleBasisShort

Short term gain basis - cost of short term portion of the sale.

totSaleBasisLong

Long term gain basis - cost of long term portion of the sale.

totSaleGains

Total gains for this sale

totSaleGainsShort

Total short term gains for this sale

totSaleGainsLong

Total long term gains for this sale

messageKey

Resource key for message to display to the user (localized).


constructor(txn: SplitTxn?, secAcct: Account, asOfDateInt: Int?, selectedDateRange: DateRange?, totSaleShares: Long, totSaleSharesShort: Long, totSaleSharesLong: Long, totSaleSharesAvailable: Long, totSaleSharesAvailableShort: Long, totSaleSharesAvailableLong: Long, totSaleValue: Long, totSaleValueShort: Long, totSaleValueLong: Long, totSaleBasis: Long, totSaleBasisShort: Long, totSaleBasisLong: Long, totSaleGains: Long, totSaleGainsShort: Long, totSaleGainsLong: Long, messageKey: String?)

Constructor - valid (complete) result with an optional message key.

Return

CapitalGainResult instance with (complete) values, marked valid, and with an optional message key.

Parameters

txn

The source txn for this sale/gain

secAcct

Security account for this gain.

asOfDateInt

The asof date used to calculate this gain.

selectedDateRange

The DateRange used when generating this gain.

totSaleShares

Number of shares sold.

totSaleSharesShort

Number of short term shares sold.

totSaleSharesLong

Number of long term shares sold.

totSaleSharesAvailable

Total number of available shares.

totSaleSharesAvailableShort

Total number of available short term shares.

totSaleSharesAvailableLong

Total number of available long term shares.

totSaleValue

Total sales value for this gain

totSaleValueShort

Short term sales value for this gain

totSaleValueLong

Long term sales value for this gain

totSaleBasis

Total combined basis for the sale transaction.

totSaleBasisShort

Short term gain basis - cost of short term portion of the sale.

totSaleBasisLong

Long term gain basis - cost of long term portion of the sale.

totSaleGains

Total gains for this sale

totSaleGainsShort

Total short term gains for this sale

totSaleGainsLong

Total long term gains for this sale

messageKey

Resource key for message to display to the user (localized).